<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>js</title>
</head>
<body>
    <script>
        // 1. 创建一个空的对象
        var obj = new Object();
        // 2. 添加属性
        obj.name = '张三';
        obj.age = 18;
        obj.sex = '男';
        // 3. 添加方法
        obj.show = function() {
            console.log(this.name + ',' + this.age + ',' + this.sex);
        }
        obj.show();
        console.log(obj);
        console.log(obj.name);
    </script>
    <script>
        var a = 1;
        var b = 2.2;
        var c = '3';
        var d = true;
        var e = null;
        var f = undefined;
        console.log(typeof a);
        console.log(typeof b);
        console.log(typeof c);
        console.log(typeof d);
        console.log(typeof e);
        console.log(typeof f);
        console.log(typeof typeof a);
    </script>
    <script>
        var a = 1;
        var b = 2;
        var c = a + b;
        var d = a + '' + b;
        var f = '1';
        // 短路运算符
        console.log(a && b);
        console.log(a || b);
        console.log(!a);
        console.log(a === f);
        console.log(c === d);
    </script>
</body>
</html>